from django.conf.urls import url
from .views import *


urlpatterns = [

    # 注册页面
    url(r'^register/$', RegisterView.as_view(), name="register"),

    # 用户名唯一性校验
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', UsernameCountView.as_view()),

    # 手机唯一性校验
    url(r'^mobiles/(?P<mobile>[a-zA-Z0-9_-]{5,20})/count/$', MobilesCountView.as_view()),

    # 登录
    url(r'^login/$', LoginView.as_view(), name="login"),

    # 登出
    url(r'^logout/$', LogOutView.as_view(), name="logout"),

    # 用户中心
    url(r'^info/$', UserInfoView.as_view(), name="info"),

    # 添加邮箱
    url(r'^emails/$', EmailView.as_view(), name="email"),

    # 邮箱激活
    url(r'^emails/verification/$', VerifyEmailView.as_view(), name="verify"),

    # 收货地址展示
    url(r'^address/$', AddressView.as_view(), name='address'),

    # 省市县查询
    url(r'^areas/$', AreasView.as_view(), name='areas'),

    # 增加地址
    url(r'^addresses/create/$', CreateAddressesView.as_view()),

    # 改 删 地址/addresses/(?P<address_id>\d+)/
    url(r'^addresses/(?P<address_id>\d+)/$', UpdateDestroyAddressView.as_view()),

    # 设置默认地址
    url(r'^addresses/(?P<address_id>\d+)/default/$', DefaultAddressView.as_view()),

    # 修改地址标题
    url(r'^addresses/(?P<address_id>\d+)/title/$', UpdateTitleAddressView.as_view()),

    # 修改密码s
    url(r'^password/$', ChangePasswordView.as_view(), name="password"),


    # 用户浏览记录
    url(r'^browse_histories/$', UserBrowseHistory.as_view(), name="histories"),

    # 忘记密码
    url(r'^find_password/$', FindPasswordView.as_view(), name="findpwd"),


]

